﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ArticleManager.aspx.cs" Inherits="Enterprise.UI.Web.Modules.Doc.ArticleManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" type="text/css" href="../../Styles/css/gridview.css" />
<script>
    function selectAll() {
        //MainPH_gv_cbselect_0
        $("input[id^='MainPH_gv_cbselect_']").attr("checked", true);
    }

    function unselectAll() {
        $("input[id^='MainPH_gv_cbselect_']").attr("checked", false);
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPH" runat="server">
 <div class="toolbars">
        <a class="easyui-linkbutton"  iconCls="icon-toolbar" plain="true"  href="/Modules/Doc/ClassManage.aspx" >栏目管理</a>
        <a class="easyui-linkbutton"  iconCls="icon-toolbar" plain="true" href="/Modules/Doc/ArticleManager.aspx">文章管理</a>
        <a class="easyui-linkbutton"  iconCls="icon-toolbar" plain="true" href="/Modules/Doc/ArticlePub.aspx">发布文章</a>
    </div>
    <div id="contents">
        <div style="padding: 5px;">
        栏目：<asp:DropDownList ID="ddl_class" runat="server" AppendDataBoundItems="true" 
                AutoPostBack="True" onselectedindexchanged="ddl_class_SelectedIndexChanged">
            </asp:DropDownList>
            标题：<asp:TextBox ID="tb_title" runat="server"></asp:TextBox>
        <asp:Button ID="btn_search" runat="server"  Text="搜索" onclick="btn_search_Click" />
            <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" 
                CssClass="GridViewStyle" AllowPaging="True" 
                onpageindexchanging="gv_PageIndexChanging">
                <Columns>
                  <asp:TemplateField HeaderText="选择" ItemStyle-Width="30" ItemStyle-Wrap="false">
                <ItemTemplate>
                    <asp:CheckBox ID="cbselect" runat="server" />
                </ItemTemplate>
                <ItemStyle Wrap="False" Width="30px"></ItemStyle>
            </asp:TemplateField>
                    <asp:BoundField DataField="ID" HeaderText="编号">
                    <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CLASSName" HeaderText="栏目" >
                    <ItemStyle HorizontalAlign="Left" Width="120px" Wrap="False" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="标题">
                        <ItemTemplate>
                            <a href="ArticlePub.aspx?id=<%#Eval("ID") %>"><%# Eval("TITLE") %></a>
                        </ItemTemplate>                        
                        <ItemStyle HorizontalAlign="Left" Width="350px" Wrap="False" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="AUTHOR" HeaderText="作者" >
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:BoundField>
                    <asp:BoundField DataField="PUBDATE" HeaderText="发布时间" >
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <a href="ArticlePub.aspx?id=<%#Eval("ID") %>" class="easyui-linkbutton"  iconCls="icon-edit" plain="true">编辑</a>
                            <a href="ArticleDelete.aspx?id=<%#Eval("ID") %>" class="easyui-linkbutton"  iconCls="icon-cancel" plain="true" onclick="return confirm('确定要删除吗？不可恢复');">删除</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="GridViewHeaderStyle" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <PagerTemplate>
                     <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>         <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页"  Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>        <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev"  ></asp:LinkButton>        <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton>         <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页"   Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton>         到第<asp:TextBox 
                         runat="server" ID="inPageNum" Width="40px"></asp:TextBox>页 
                     <asp:Button ID="Button1" CommandName="go" runat="server" Text="Go" 
                         onclick="Button1_Click" />
                </PagerTemplate>
                <RowStyle CssClass="GridViewRowStyle" />
                <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PageButtonCount="5"
                    PreviousPageText="上一页" />
            </asp:GridView>
        </div>
        <div>
        &nbsp;<a href="#"  onclick="selectAll();" class="easyui-linkbutton" >全选</a>&nbsp;&nbsp;<a  class="easyui-linkbutton"  href="#"  onclick="unselectAll();">取消全选</a>
        &nbsp;&nbsp;<asp:LinkButton ID="lb_delete" runat="server" Text="删除" 
                OnClientClick="return confirm('确定要批量删除选中吗？不可恢复')" CssClass= "easyui-linkbutton" 
                onclick="lb_delete_Click"  />
    &nbsp;</div>
    </div>
</asp:Content>
